review(stark): address PR #735 review — coverage, dead code, cleanups#740
Merged
diegokingston merged 1 commit intoJun 29, 2026
Merged
Conversation
3dba2df to
f6877ca
Compare
Follow-up to the row-pair commitment PR. Excludes the intentional proof-format break (proof_sym removal / leaf-count change), which is by design. Test coverage (in their own files under crypto/stark/src/tests/, per the crate's test structure): - tests/commitment_tests.rs: direct unit tests pinning the row-pair leaf layout (R=1 and R=2) against an independent reference, wrapper agreement, commit-root consistency, and empty-input short-circuit. Previously the leaf layout was only covered transitively via full prove->verify, and GPU parity tests compared against an inline reimpl rather than this module. - tests/row_pair_opening_tests.rs: two negative tests for the row-pair verify_opening_pair — a tampered symmetric trace evaluation and a corrupted Merkle authentication path must both be rejected. Removing proof_sym deleted the old "symmetric opening mismatch" rejection class; these restore it (an impl ignoring evaluations_sym / the auth path would otherwise pass every existing test). Reuses the now pub(crate) make_valid_simple_proof helper. - cuda_path_integration.rs: restore assert!(gpu_comp_poly_tree_calls() > 0). try_build_comp_poly_tree_gpu is dispatched unconditionally (round 2, after the parts-count branch), so it fires for the common number_of_parts == 2 (degree-3) case — it was NOT obsolete. Keep the genuinely-dead parts-LDE assertion dropped. Cleanups: - Delete dead fn commit_plain (zero callers; main/aux commit inline commit_rows_bit_reversed + spill_tree, which are row-major and incompatible with its column-major signature — the dedup never landed). - Delete orphaned pub fn columns2rows (all callers removed by #735). - Add ProvingError::Fft and map FFTError to it instead of WrongParameter (internal FFT failure is not a caller-supplied-parameter error). - Fix stale profiler label commit_composition_poly -> commit_bit_reversed. - Drop the rot-prone "// = 2" comment on the local ROWS_PER_LEAF alias.
f6877ca to
1abb9d3
Compare
MauroToscano
added a commit
that referenced
this pull request
Jun 29, 2026
#744) Two items that landed too late for #740: - Move the shared make_valid_simple_proof helper out of small_trace_tests.rs into tests/trace_test_helpers.rs, where the crate keeps shared test helpers (matching how prover_tests sources get_trace_evaluations). row_pair_opening_tests.rs and small_trace_tests.rs now both import it from there instead of one test file reaching sideways into another. - Delete AGENTS.md (added by #735).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #735 (
perf/commitment-row-pair) addressing findings from an adversarial review. Targets the #735 branch so the fixes land with it. The intentional proof-format break (proof_symremoval / leaf-count change) is left as-is — that's by design.Soundness of the row-pair change itself was verified clean (CPU commit ↔ GPU kernels ↔ verifier are byte-consistent; Fiat-Shamir transcript order preserved). These changes harden coverage and remove leftovers. New tests live in their own files under
crypto/stark/src/tests/, matching the crate's test layout.Test coverage (MEDIUM findings)
tests/commitment_tests.rs(new) — direct unit tests pinning the row-pair leaf layout (R=1 and R=2) against an independent reference, wrapper agreement, commit-root consistency, and empty-input short-circuit. The layout was previously only covered transitively via full prove→verify; the GPU parity tests compare against an inline reimpl, not this module.tests/row_pair_opening_tests.rs(new) — two negative tests for the row-pairverify_opening_pair: a tampered symmetric trace evaluation and a corrupted Merkle authentication path must both be rejected. Removingproof_symdeleted the old "symmetric opening mismatch" rejection class; an impl that ignoredevaluations_symor the auth path would otherwise pass every existing test. (Reuses the nowpub(crate)make_valid_simple_proofhelper.)cuda_path_integration.rs— restoreassert!(gpu_comp_poly_tree_calls() > 0).try_build_comp_poly_tree_gpuis dispatched unconditionally (round 2, after the parts-count branch), so it fires for the commonnumber_of_parts == 2(degree-3) case — it was not obsolete. The genuinely-dead parts-LDE assertion stays dropped. (Note: this test iscuda-gated, so it's only exercised on a GPU runner.)Cleanups (LOW)
fn commit_plain(zero callers; main/aux paths inlinecommit_rows_bit_reversed+spill_tree, which are row-major and incompatible with its column-major signature — the advertised dedup never landed).pub fn columns2rows(all callers removed by refactor(stark): unify & clean up the commitment layer #735).ProvingError::Fftand mapFFTErrorto it instead ofWrongParameter(internal FFT failure isn't a caller-supplied-parameter error; message preserved).commit_composition_poly→commit_bit_reversed.// = 2comment on the localROWS_PER_LEAFalias.Deliberately not changed
debug_assert!precondition checks incommitment.rsstaydebug_assert!. This is prover-side: a violated invariant yields a proof the verifier rejects, not a soundness break, so it's not worth a release-mode panic. The debug build still catches it in dev/test.Verification
cargo test -p stark— passes (4 commitment tests + 2 row-pair opening tests + existing suite).make lint— clean across all three combos (default /--no-default-features --features debug-checks/disk-spill).cuda_path_integrationassertion is restored by inspection.Not addressed (out of scope per request)
spec/main/md_spec) update for the new leaf layout — flagged for the spec owner.